{% extends "two_column_body.html" %}
{% import "authopenid/authopenid_macros.html" as login_macros %}
{% import "macros.html" as main_macros %}
<!--signup.html-->
{% block title %}{% spaceless %}{% trans %}Signup{% endtrans %}{% endspaceless %}{% endblock %}
{% block tooltip %}<div class="input-tool-tip">search or ask your question</div>{% endblock %}
{% block forestyle %}
    <link rel="stylesheet" type="text/css" media="screen" href="{{"/jquery-openid/openid.css"|media}}"/>
{% endblock %}
{% block content %}
{% if settings.PASSWORD_REGISTER_SHOW_PROVIDER_BUTTONS == True %}
    <h1 class="section-title">{% trans %}Please register by clicking on any of the icons below{% endtrans %}</h1>
    <form id="signin-form" method="post" action="{{ settings.LOGIN_URL }}">{% csrf_token %}
        {# hide_local_login == True because it is password reg form #}
        {{ 
            login_macros.provider_buttons(
                login_form = login_form,
                major_login_providers = major_login_providers,
                minor_login_providers = minor_login_providers,
                hide_local_login = True,
                settings = settings
            )
        }}
    </form>
    <h2 style="margin-top: 10em; margin-bottom: 0">{% trans %}or create a new user name and password here{% endtrans %}</h2>
{% else %}
    <h1 class="section-title" style="margin-top: 1em">{% trans %}Create login name and password{% endtrans %}</h1>
{%endif%}
<form id="signup-form" action="{% url user_signup_with_password %}" method="post" accept-charset="utf-8">{% csrf_token %}
    {{form.login_provider}}
    <table class="form-horizontal-rows" style="width: 100%">
        <tbody style="font-size: 1.2em;">
            <tr>
                <td style="padding: 0.5em 0 0.5em 0;">
                    <label for="usename_id">{{form.username.label}}</label>
                </td>
                <td style="padding: 0.5em 0 0.5em 0;">
                    {{form.username}}{{form.username.errors}}
                </td>
            </tr>
            <tr>
                <td style="padding: 0.5em 0 0.5em 0;">
                    <label for="email_id">{{form.email.label}}</label>
                </td>
                <td style="padding: 0.5em 0 0.5em 0;">
                    {{form.email}}{{form.email.errors}}
                </td>
            </tr>
            <tr>
                <td style="padding: 0.5em 0 0.5em 0;">
                    <label for="password1_id">{{form.password1.label}}</label>
                </td>
                <td style="padding: 0.5em 0 0.5em 0;">
                    {{form.password1}}{{form.password1.errors}}
                </td>
            </tr>
            <tr>
                <td style="padding: 0.5em 0 0.5em 0;">
                    <label for="password2_id">{{form.password2.label}}</label>
                </td>
                <td style="padding: 0.5em 0 0.5em 0;">
                    {{form.password2}}{{form.password2.errors}}
                </td>
            </tr>
        </tbody>
    </table>
    {% if form.recaptcha %}
        {{ main_macros.form_field_with_errors(form.recaptcha) }}
    {% endif %}
    <div class="submit-row"><input id="signup-button" type="submit" class="normal-btn button" value="{% trans %}Signup{% endtrans %}" /> 
    {% if settings.PASSWORD_REGISTER_SHOW_PROVIDER_BUTTONS == False %}
        <strong>{% trans %}or{% endtrans %}
        <a href="{{ settings.LOGIN_URL }}">{% trans %}return to OpenID login{% endtrans %}</a></strong>
    {% endif %}
    </div>
</form>
{% endblock %}
{% block endjs %}
    {% include "authopenid/providers_javascript.html" %}
    {{ main_macros.one_shot_form_js(form="#signup-form", submit_button="#signup_button") }}
{% endblock %}
<!--end signup.html-->
